#ifndef DW_BASE_SINGLETON_H
#	define DW_BASE_SINGLETON_H

namespace dw {
	namespace base {

template< typename T, bool AutoCreate = true >
class Singleton
{
public : //! @name Commands
	//! @{
	static T& createInstance();
	static void destroyInstance();
	//! @}

public : //! @name State
	//! @{
	static T& getInstance();
	//! @}

protected : //! @name Construction & destruction
	//! @{
	Singleton();
	virtual ~Singleton();
	//! @}

private : //! @name Prevents copy
	//! @{
	Singleton(const Singleton& ref);
	//! @}

private : //! @name Data
	//! @{
	static T* m_instance;
	//! @}
};

	} // namespace base 
} // namespace dw 

#include "base/singleton.inl"

#endif // !DW_BASE_SINGLETON_H
